-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This part is unnecessary in wgpu_integration.rs #5043
Conversation
let clear_color = self | ||
.app | ||
.clear_color(&self.integration.egui_ctx.style().visuals); | ||
|
||
let has_many_viewports = self.glutin.borrow().viewports.len() > 1; | ||
let clear_before_update = !has_many_viewports; // HACK: for some reason, an early clear doesn't "take" on Mac with multiple viewports. | ||
|
||
if clear_before_update { | ||
// clear before we call update, so users can paint between clear-color and egui windows: | ||
|
||
let mut glutin = self.glutin.borrow_mut(); | ||
let GlutinWindowContext { | ||
viewports, | ||
current_gl_context, | ||
not_current_gl_context, | ||
.. | ||
} = &mut *glutin; | ||
let viewport = &viewports[&viewport_id]; | ||
let Some(window) = viewport.window.as_ref() else { | ||
return Ok(EventResult::Wait); | ||
}; | ||
let Some(gl_surface) = viewport.gl_surface.as_ref() else { | ||
return Ok(EventResult::Wait); | ||
}; | ||
|
||
let screen_size_in_pixels: [u32; 2] = window.inner_size().into(); | ||
|
||
{ | ||
frame_timer.pause(); | ||
change_gl_context(current_gl_context, not_current_gl_context, gl_surface); | ||
frame_timer.resume(); | ||
} | ||
|
||
self.painter | ||
.borrow() | ||
.clear(screen_size_in_pixels, clear_color); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this break test_inline_glow_paint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this break
test_inline_glow_paint
?
(The plan was to PR wgpu and glow separately.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this break
test_inline_glow_paint
?
As planned, I will test glow separately and if there are no issues, I will PR again.
It was a mistake that I didn't check to make sure that glow was included in this PR. Sorry about that.
This part is unnecessary, as we call
remove_viewports_not_in()
in thehandle_viewport_output()
function right before it.